
*******************************************************
*** MASTER REPLICATION FILE ***************************
*******************************************************
* Purpose:
* This do-file replicates all regression models used in the
* online appendix of the book. 
*
* Last updated: 22 Nov 2025
* Stata version: 19.5
*
*
* ORGANIZATION:
*   Full results: Logit Models (Tables 2–3)
*   Full results: Generalized Logit Models (Tables 4–5)
*   Full results: Multinomial Logit Models (Tables 6–7)
*   Alternate measures (Tables 8–9)
*   Socialization & Learning (Tables 10–11)
*   Time period interactions (Tables 12–13)
*
* USER GUIDE:
*   1. Download dataset: fulldata_vars_Nov2025.dta
*   2. Save locally and update the file path below.
*   3. Open Stata and run this do-file.
*   4. Stored estimates can be exported using esttab, outreg2, or asdoc.
*******************************************************


*------------------------------------------------------
* SETUP: the full results model uses the same dataset
*------------------------------------------------------
* Clear workspace
clear all

* Load the cleaned Adversarial Agreements dyadic dataset (Nov 2025 version)
* NOTE: Update the filepath if your directory structure has changed
use "AAD_fulldata_vars_Nov2025.dta", replace



*******************************************************
*** Full results: Logit models ************************
*** Tables 2-3 in the Appendix ************************
*******************************************************
*-----------------------------------------------
* Table 2
* CE Effects on Probability of a Treaty (logit)
*-----------------------------------------------
* Model 1 - baseline CE model
logit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources t t2 t3, ///
    cluster(dyadid) or
estimates store ce1

* Model 2 - add gdp
logit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5  gdp t t2 t3, ///
    cluster(dyadid) or
estimates store ce2

* Model 3 - add satellites, treaty experience, rivalry
logit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources satellites Trival dExpert t t2 t3, ///
    cluster(dyadid) or
estimates store ce3

* Model 4 - add US-Russia and India-Pakistan
logit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources satellites Trival dExpert US_Rus Ind_Pak t t2 t3, ///
    cluster(dyadid) or
estimates store ce4

* Model 5 - fixed effects logistic regression
xtlogit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources t t2 t3, ///
    fe or
estimates store ce5

*-----------------------------------------------
* Table 3
* DRS Effects on Probability of a Treaty (logit)
*-----------------------------------------------

* Model 1 - baseline DRS model
logit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources t t2 t3, ///
    cluster(dyadid) or
estimates store drs1

* Model 2 - add GDP
logit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 gdp t t2 t3, ///
    cluster(dyadid) or
estimates store drs2

* Model 3 - add satellites, treaty experience, rivalry
logit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 satellites resources dExpert Trival t t2 t3, cluster(dyadid) or
estimates store drs3

* Model 4 - add US-Russia and India-Pakistan
logit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 satellites resources dExpert Trival US_Rus Ind_Pak t t2 t3, ///
    cluster(dyadid) or
estimates store drs4

* Model 5 - fixed effects logistic regression
xtlogit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources t t2 t3, ///
    fe or
estimates store drs5



*******************************************************
*** Full results: Generalized logit models ************
*** Table 4-5 in the Appendix *************************
*******************************************************
*-----------------------------------------------
* Table 4
* CE Change Volatility (CE Change) Effects on the Probability of Treaty Types (gologit)
*-----------------------------------------------
*Model 1 – base model 
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid) rrr
estimates store goce1

* Model 2 – adds satellites
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources satellites t t2 t3, cluster(dyadid) rrr
estimates store goce2


* Model 3 – adds treaty experience (dExpert)
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dExpert t t2 t3, cluster(dyadid) rrr
estimates store goce3

* Model 4 – adds US-Russia and India-Pakistan (US_Rus and Ind_Pak)
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources US_Rus Ind_Pak t t2 t3, cluster(dyadid) rrr
estimates store goce4

*-----------------------------------------------
* Table 5
* Demonstrations, Riots, or Strikes Volatility (DRS Events) on the Probability of Treaty Types (gologit)
*-----------------------------------------------
* Model 1
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid) rrr
estimates store godrs1

* Model 2 – adds satellites
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources satellites t t2 t3, cluster(dyadid) rrr
estimates store godrs2

* Model 3 – adds treaty experience
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dExpert t t2 t3, cluster(dyadid) rrr
estimates store godrs3

* Model 4 – adds US/Russia, India/Pakistan indicators
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources US_Rus Ind_Pak t t2 t3, cluster(dyadid) rrr
estimates store godrs4



*******************************************************
*** Full results: multinomial logit models ************
*** Tables 6–7 in the Appendix ************************
*******************************************************
*-----------------------------------------------
* Table 6
* Cabinet or Executive Change Volatility (CE Change) Effects on Probability of Treaty Types (mlogit)
*-----------------------------------------------

* Model 1: Base model with CE change interaction and core controls
mlogit DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid)
estimates store mce1

* Model 2: Adds satellite capability indicator
mlogit DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources satellites t t2 t3, cluster(dyadid)
estimates store mce2

* Model 3: Adds expert-coded capability variable
mlogit DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dExpert t t2 t3, cluster(dyadid)
estimates store mce3

* Model 4: Adds dyadic nuclear rival indicators (US-Russia, India-Pakistan)
mlogit DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources US_Rus Ind_Pak t t2 t3, cluster(dyadid)
estimates store mce4

*-----------------------------------------------
* Table 7
* Demonstrations, Riots, Strikes Volatility (DRS events)  Effects on Probability of Treaty Types (mlogit)
*-----------------------------------------------

* Model 1: Base model with DRS interaction and core controls  
mlogit DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid)
estimates store mdrs1

* Model 2: Adds satellite capability indicator  
mlogit DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources satellites t t2 t3, cluster(dyadid)
estimates store mdrs2

* Model 3: Adds expert-coded capability variable  
mlogit DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dExpert t t2 t3, cluster(dyadid)
estimates store mdrs3

* Model 4: Adds dyadic nuclear rival indicators (US-Russia, India-Pakistan)  
mlogit DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources US_Rus Ind_Pak t t2 t3, cluster(dyadid)
estimates store mdrs4


*******************************************************
*** Alternate Measures ********************************
*** Tables 8–10 in the Appendix ***********************
*******************************************************
*-----------------------------------------------
* Table 8
* Alternative belief measures, CE change (gologit)
*-----------------------------------------------
* Model 6 – Preference similarity (Lupu)
gologit2 DVtypeALT i.moreCE##c.treaty_distance_lag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid) rrr
estimates store goce6

* Model 7 – Thompson rivalry dyads
gen Trival_lag2 = (L2.Trival == 1)
replace Trival_lag2 = 0 if missing(Trival_lag2)

gologit2 DVtypeALT i.moreCE##i.Trival_lag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid) rrr
estimates store goce7

* Model 8 – Affinity
xtset dyadid year, yearly
sort dyadid year
gen s3unlag2 = L2.s3un

gologit2 DVtypeALT i.moreCE##c.s3unlag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid) rrr
estimates store goce8

*-----------------------------------------------
* Table 9
* Alternative belief measures, DRS change (gologit)
*-----------------------------------------------
* Model 6 – Preference similarity (Lupu)
gologit2 DVtypeALT i.moreDRS##c.treaty_distance_lag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid)
estimates store godrs6

* Model 7 – Enduring rivalry (Thompson)
gen Trival_lag2 = (L2.Trival == 1)
replace Trival_lag2 = 0 if missing(Trival_lag2)

gologit2 DVtypeALT i.moreDRS##i.Trival_lag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid)
estimates store godrs7

* Model 8 – UN Affinity
xtset dyadid year, yearly
sort dyadid year
gen s3unlag2 = L2.s3un

gologit2 DVtypeALT i.moreDRS##c.s3unlag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources t t2 t3, cluster(dyadid)
estimates store godrs8


*******************************************************
*** Socialization and Learning ************************
*** Tables 10–11 in the Appendix **********************
*******************************************************
*-----------------------------------------------
* Table 10
* Socialization and Learning Hypotheses: CE Change Effects
*-----------------------------------------------
* CE Volatility Models
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources ongoingT t t2 t3, cluster(dyadid)
estimates store goceT5

gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources dFamiliar t t2 t3, cluster(dyadid)
estimates store goceT10

gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dSavvy t t2 t3, cluster(dyadid)
estimates store gocesav

gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dExpert t t2 t3, cluster(dyadid)
estimates store goceexp


*-----------------------------------------------
* Table 11
* Socialization and Learning Hypotheses: DRS Change Effects (gologit)
*-----------------------------------------------
* DRS Volatility Models
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources ongoingT t t2 t3, cluster(dyadid)
estimates store godrsT5

gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources dFamiliar t t2 t3, cluster(dyadid)
estimates store godrsT10

gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dSavvy t t2 t3, cluster(dyadid)
estimates store godrssav

gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld ongoingT bothnuke midhist5 diehlar5 resources dExpert t t2 t3, cluster(dyadid)
estimates store godrsexp

*******************************************************
*** Time Period Interactions ************************
*** Tables 12–13 in the Appendix **********************
*******************************************************
*-----------------------------------------------
* Table 12
* CE change and DRS effects with time periods (logit)
*-----------------------------------------------
* CE Change × Post-Cold War
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources ongoingT postcoldwar t t2 t3, cluster(dyadid)
estimates store gocoldwar

* CE Change × Policy distance (full sample)
gologit2 DVtypeALT i.moreCE##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources ongoingT t t2 t3, cluster(dyadid)
estimates store goreg

* DRS Events × Policy distance × Post-Cold War
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources ongoingT postcoldwar t t2 t3, cluster(dyadid)
estimates store goDRScoldwar

* DRS Events × Policy distance (full sample)
gologit2 DVtypeALT i.moreDRS##c.UNvotelag2 bofcowdy contigld bothnuke midhist5 diehlar5 resources ongoingT t t2 t3, cluster(dyadid)
estimates store goDRSreg


*-----------------------------------------------
* Table 13
* CE & DRS Effects with Time Periods (gologit)
*-----------------------------------------------

* CE model with time periods
logit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources pre1945 postcoldwar t t2 t3, ///
    cluster(dyadid) or
estimates store logCEregtime

* CE model with fixed effects
xtlogit DVtreaty moreCE bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources pre1945 postcoldwar t t2 t3, ///
    fe or
estimates store logCEfetime

* DRS model with time periods
logit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources pre1945 postcoldwar t t2 t3, ///
    cluster(dyadid) or
estimates store logDRSregtime

* DRS model with fixed effects
xtlogit DVtreaty moreDRS bofcowdy contigld ongoingT bothnuke diehlar5 midhist5 resources pre1945 postcoldwar t t2 t3, ///
    fe or
estimates store logDRSfetime




*******************************************************
*** END OF MASTER FILE *******************************
*******************************************************
